from pydantic import BaseModel
from datetime import datetime
from typing import Optional

class AlertCreate(BaseModel):
    title: str
    content: str
    alert_time: datetime  # 提醒时间（UTC）
    repeat: Optional[str] = "none"  # 重复规则

class AlertUpdate(BaseModel):
    title: Optional[str] = None
    content: Optional[str] = None
    is_active: Optional[bool] = None

class AlertResponse(AlertCreate):
    id: int
    is_active: bool
    created_at: datetime

    class Config:
        orm_mode = True  # 支持SQLAlchemy模型转换